package mobilesearch.receiver;

import java.util.ArrayList;

import mobilesearch.data.BookmarkData;
import mobilesearch.ui.OnSearchResultListener;
import android.util.Log;

public class BookmarkReceiver {

	private static final String TAG = "BookmarkReceiver";
	private ArrayList<BookmarkData> bookmarkList;
	private OnSearchResultListener listener;
	
	public BookmarkReceiver(ArrayList<BookmarkData> bookmarkList, OnSearchResultListener listener) {
		this.bookmarkList = bookmarkList;
		this.listener = listener;
	}
	
	public void processBookmarkData(){
		int size = this.bookmarkList.size();
		Log.i(TAG, "bookmark list"+ size);
		for(int i = 0; i < size; i++){
			BookmarkData data = this.bookmarkList.get(i);
			String title = data.getTitle();
			String url = data.getUrl();
			this.listener.onReceiveBookmarkData(title, url);
		}
	}


}
